from spargameproject.spargame.game.engine.game_engine import PlayHandler

class GetCardsHandler(PlayHandler):
  def getType(self):
    return 'get_cards'

  def handlePlay(self, play, game_engine):
    game = play.game
    session = game.getMetadata('session')
    play.setMetadata('session', session)
    game_player = game.gameplayer_set.get(player=play.player)
    session = game.getMetadata('session')
    return [], { 'hand': [card.fileFormat if card else None for card in game_player.getMetadata('cards_left')] }
